<template>
	<view class="app">
		<view class="box">
			<!-- 每个卡片项 -->
			<view class="box-son">
				<view class="box-s-1">
					<view class="box-s-left">
						<text class="box-s-username">张三</text>
						<view class="star-box">
							<text class="tn-icon-star-fill"></text>
						</view>
					</view>
					<view class="box-s-right">
						09月19日 19:33
					</view>
				</view>
				<view class="box-s-2">
					下次还点你
				</view>
				<view class="box-s-3">
					<text>穿戴工服</text>
					<text>穿戴工服</text>
					<text>穿戴工服</text>
					<text>穿戴工服</text>
				</view>
			</view>

			<!-- 遍历数据集 -->
			<view v-for="(item,index) in dataList" :key="index" class="box-son">
				<view class="box-s-1">
					<view class="box-s-left">
						<text class="box-s-username">{{item.username}}</text>
						<view class="star-box">
							<text v-for="i in item.starNum" class="tn-icon-star-fill"></text>
						</view>
					</view>
					<view class="box-s-right">
						{{item.time}}
					</view>
				</view>
				<view class="box-s-2">
					{{item.comment}}
				</view>
				<view class="box-s-3">
					<text v-for="(tag,tagindex) in item.tags">{{tag}}</text>

				</view>

			</view>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList: [{
						username: 'Vip用户',
						starNum: 2,
						time: '8月15日 14:38',
						comment: '下次还点你',
						tags: ['穿戴整洁', '热情礼貌']
					},
					{
						username: 'Vip用户',
						starNum: 4,
						time: '8月15日 14:38',
						comment: '下次还点你',
						tags: ['穿戴整洁', '热情礼貌', '穿戴工服', '热情礼貌']
					},
					{
						username: '我是一个很长的用户名',
						starNum: 5,
						time: '8月15日 14:38',
						comment: '下次还点你',
						tags: ['穿戴整洁', '热情礼貌', '穿戴整洁', '热情礼貌']
					},
					{
						username: 'Vip用户',
						starNum: 1,
						time: '8月15日 14:38',
						comment: '下次还点你',
						tags: ['穿戴整洁', '热情礼貌']
					}
				]
			}
		}
	}
</script>

<style>
	.app {
		padding: 20rpx;
		box-sizing: border-box;
	}

	.box {
		padding: 20rpx;
		padding-right: 0;
		box-sizing: border-box;
		box-shadow: 4rpx 4rpx 10rpx 0 #d9d9d9;
		display: flex;
		flex-direction: column;

	}

	.tn-icon-star-fill {
		color: #f37b1d;
	}

	.box-son {
		padding: 20rpx;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		gap: 28rpx;
		border-top: 1px solid #f4f4f4;
	}

	.box-s-1 {
		display: flex;
		justify-content: space-between;
	}

	.box-s-left {
		display: flex;
		gap: 8rpx;
		font-size: 32rpx;
	}

	.box-s-right {
		font-size: 28rpx;
		color: #abb2b8;
	}

	.box-s-2 {
		font-size: 32rpx;
		color: #abb2b8;
	}

	.box-s-3 {
		display: flex;
		flex-wrap: wrap;
		gap: 20rpx;
	}

	.box-s-3>text {
		width: 150rpx;
		height: 48rpx;
		text-align: center;
		border-radius: 10rpx;
		box-sizing: border-box;
		background-color: #f1f1f1;
		line-height: 48rpx;
		color: #757170;
	}

	.box-s-username {
		max-width: 260rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.box-son .star-box {
		display: flex;
		gap: 2rpx;
	}
</style>